#ifndef __BASE_MEMORYLEAKDETECTOR_H__
#define __BASE_MEMORYLEAKDETECTOR_H__

#ifdef WIN32
#ifdef _DEBUG

	#ifndef _DEBUG_WIN32
	#define _DEBUG_WIN32
	#endif //_DEBUG_WIN32

	#ifndef CRT_DEBUG_NEW
		#if defined _AFX || defined _AFXDLL
			#include <afx.h>
			//#include <afxdisp.h>
			#define CRT_DEBUG_NEW DEBUG_NEW
		#else //defined _AFX || defined _AFXDLL
			#define _CRTDBG_MAP_ALLOC
			#include <stdlib.h>
			#include <crtdbg.h>
			#define CRT_DEBUG_NEW new(_NORMAL_BLOCK,__FILE__, __LINE__)
			
		#endif //_AFX
	#endif //CRT_DEBUG_NEW

#ifdef new
#error "new"
#endif
	#define new CRT_DEBUG_NEW

#endif //_DEBUG
#endif //WIN32

#else //__BASE_MEMORYLEAKDETECTOR_H__
	#error "Please do not include this file in the header file"
#endif //__BASE_MEMORYLEAKDETECTOR_H__
